function showName() {
    $.ajax({
        url: "/user/showName",
        type: "GET",
        dataType: "JSON",
        success: function (json) {
            let username = json.username;
            let userType = json.userType;
            if (username != undefined && username != "") {
                $("#showName").html("欢迎，" + username);
            } else {
                $("#loginPoint").empty();
                $("#loginPoint").append('<a href="login.html"><span class="fa fa-user"></span>&nbsp;登录</a>');
            }
            if (userType == 0) {
                $("#tools").empty();
                $("#tools").append(
                    '                <li><a href="orders.html"><span class="fa fa-file-text"></span>&nbsp;订单</a></li>\n' +
                    '                <li class="li-split">|</li>\n' +
                    '                <li><a href="cart.html"><span class="fa fa-cart-plus"></span>&nbsp;购物车</a></li>\n' +
                    '                <li class="li-split">|</li>\n' +
                    '                <li>\n' +
                    '                    <!--下列列表按钮 ：管理-->\n' +
                    '                    <div class="btn-group">\n' +
                    '                        <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">\n' +
                    '                            <span id="top-dropdown-btn"><span class="fa fa-gears"></span>&nbsp;个人中心 <span\n' +
                    '                                    class="caret"></span></span>\n' +
                    '                        </button>\n' +
                    '                        <ul class="dropdown-menu top-dropdown-ul" role="menu">\n' +
                    '                            <li><a href="password.html">修改密码</a></li>\n' +
                    '                            <li><a href="userdata.html">个人资料</a></li>\n' +
                    '                            <li><a href="upload.html">上传头像</a></li>\n' +
                    '                            <li><a href="address.html">收货管理 </a></li>\n' +
                    '                        </ul>\n' +
                    '                    </div>\n' +
                    '                </li>\n' +
                    '                <li class="li-split">|</li>\n' +
                    '                <li id="loginPoint">\n' +
                    '                    <div class="btn-group">\n' +
                    '                        <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">\n' +
                    '                            <span id="user-dropdown-btn">\n' +
                    '                                <span id="showName"></span>\n' +
                    '                                <span class="caret"></span>\n' +
                    '                            </span>\n' +
                    '                        </button>\n' +
                    '                        <ul class="dropdown-menu top-dropdown-ul" role="menu">\n' +
                    '                            <li><a href="login.html">退出登录</a></li>\n' +
                    '                        </ul>\n' +
                    '                    </div>\n' +
                    '                </li>');
                if (username != undefined && username != "") {
                    $("#showName").html("欢迎，" + username);
                } else {
                    $("#loginPoint").empty();
                    $("#loginPoint").append('<a href="login.html"><span class="fa fa-user"></span>&nbsp;登录</a>');
                }
            } else if (userType == 1 || userType == 2) {
                $("#tools").empty();
                $("#tools").append(
                    '                <li>\n' +
                    '                    <!--下列列表按钮 ：管理-->\n' +
                    '                    <div class="btn-group">\n' +
                    '                        <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">\n' +
                    '                            <span id="top-dropdown-btn"><span class="fa fa-gears"></span>&nbsp;个人中心 <span\n' +
                    '                                    class="caret"></span></span>\n' +
                    '                        </button>\n' +
                    '                        <ul class="dropdown-menu top-dropdown-ul" role="menu">\n' +
                    '                            <li><a href="passwordSeller.html">修改密码</a></li>\n' +
                    '                            <li><a href="userdataSeller.html">个人资料</a></li>\n' +
                    '                            <li><a href="uploadSeller.html">上传头像</a></li>\n' +
                    '                        </ul>\n' +
                    '                    </div>\n' +
                    '                </li>\n' +
                    '                <li class="li-split">|</li>\n' +
                    '                <li id="loginPoint">\n' +
                    '                    <div class="btn-group">\n' +
                    '                        <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">\n' +
                    '                            <span id="user-dropdown-btn">\n' +
                    '                                <span id="showName"></span>\n' +
                    '                                <span class="caret"></span>\n' +
                    '                            </span>\n' +
                    '                        </button>\n' +
                    '                        <ul class="dropdown-menu top-dropdown-ul" role="menu">\n' +
                    '                            <li><a href="login.html">退出登录</a></li>\n' +
                    '                        </ul>\n' +
                    '                    </div>\n' +
                    '                </li>');
                if (username != undefined && username != "") {
                    $("#showName").html("欢迎，" + username);
                } else {
                    $("#loginPoint").empty();
                    $("#loginPoint").append('<a href="login.html"><span class="fa fa-user"></span>&nbsp;登录</a>');
                }
            } else {
                $("#tools").empty();
                $("#tools").append(
                    '                <li id="loginPoint">\n' +
                    '                    <div class="btn-group">\n' +
                    '                        <button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown">\n' +
                    '                            <span id="user-dropdown-btn">\n' +
                    '                                <span id="showName"></span>\n' +
                    '                                <span class="caret"></span>\n' +
                    '                            </span>\n' +
                    '                        </button>\n' +
                    '                        <ul class="dropdown-menu top-dropdown-ul" role="menu">\n' +
                    '                            <li><a href="login.html">退出登录</a></li>\n' +
                    '                        </ul>\n' +
                    '                    </div>\n' +
                    '                </li>');
                if (username != undefined && username != "") {
                    $("#showName").html("欢迎，" + username);
                } else {
                    $("#loginPoint").empty();
                    $("#loginPoint").append('<a href="login.html"><span class="fa fa-user"></span>&nbsp;登录</a>');
                }
            }
        }
    });
}